﻿using System.Data.Entity.ModelConfiguration;
using Nop.Plugin.Pricing.PreciousMetals.Domain;

namespace Nop.Plugin.Pricing.PreciousMetals.Data
{
    public class PreciousMetalsQuoteMap : EntityTypeConfiguration<PreciousMetalsQuote>
    {
        public PreciousMetalsQuoteMap()
        {
            this.ToTable("PreciousMetalsQuote");
            this.HasKey(x => x.Id);

            this.Property(x => x.Ask).HasPrecision(18, 4);
            this.Property(x => x.Bid).HasPrecision(18, 4);
            this.Property(x => x.Change).HasPrecision(18, 4);
            this.Property(x => x.ChangePercent).HasPrecision(18, 4);
            this.Property(x => x.Date);
            this.Property(x => x.High).HasPrecision(18, 4);
            this.Property(x => x.Low).HasPrecision(18, 4);
            this.Property(x => x.MetalType);
            this.Property(x => x.DateRetrieved);
        }
    }
}
